package com.ruge.algorithm.sort;

import java.util.Arrays;

/**
 * @program: ruge-algorithm
 * @description:
 * @author: ruge.wu
 * @create: 2021-12-19 22:35
 **/
public class SelectionTest {
    public static void main(String[] args) {
        //原始数据
//        Integer[] a = {4, 6, 8, 7, 9, 2, 10, 1};
        Integer[] a = {10,9,8,7,6,5,4,3,2,1};
        Selection.sort(a);

        //元素比较的次数:45
        //元素交换的次数:9
        //[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
        System.out.println(Arrays.toString(a));
    }
}
